home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr45 / mdidmo.zip / MDILOGO2.FRM < prev    next >
Text File  |  1994-04-12  |  5KB  |  187 lines

  1. VERSION 2.00
  2. Begin Form frmChild 
  3.    Caption         =   "Form2"
  4.    ClientHeight    =   3225
  5.    ClientLeft      =   1620
  6.    ClientTop       =   2865
  7.    ClientWidth     =   6885
  8.    FontBold        =   -1  'True
  9.    FontItalic      =   -1  'True
  10.    FontName        =   "MS Sans Serif"
  11.    FontSize        =   30
  12.    FontStrikethru  =   0   'False
  13.    FontUnderline   =   0   'False
  14.    Height          =   3915
  15.    Left            =   1560
  16.    LinkTopic       =   "Form2"
  17.    MDIChild        =   -1  'True
  18.    ScaleHeight     =   3225
  19.    ScaleWidth      =   6885
  20.    Top             =   2235
  21.    Visible         =   0   'False
  22.    Width           =   7005
  23.    Begin CommandButton Command1 
  24.       Caption         =   "&Hide Me!"
  25.       Height          =   345
  26.       Left            =   180
  27.       TabIndex        =   0
  28.       Top             =   180
  29.       Width           =   1755
  30.    End
  31.    Begin Menu mMain 
  32.       Caption         =   "&Child"
  33.       Index           =   0
  34.       Begin Menu mForm 
  35.          Caption         =   "&Hide "
  36.          Index           =   0
  37.          Shortcut        =   ^H
  38.       End
  39.       Begin Menu mForm 
  40.          Caption         =   "&Unload "
  41.          Index           =   1
  42.          Shortcut        =   ^U
  43.       End
  44.       Begin Menu mForm 
  45.          Caption         =   "-"
  46.          Index           =   2
  47.       End
  48.       Begin Menu mForm 
  49.          Caption         =   "&Show All"
  50.          Index           =   3
  51.          Shortcut        =   ^S
  52.       End
  53.       Begin Menu mForm 
  54.          Caption         =   "-"
  55.          Index           =   4
  56.       End
  57.       Begin Menu mForm 
  58.          Caption         =   "E&xit"
  59.          Index           =   5
  60.          Shortcut        =   ^X
  61.       End
  62.    End
  63.    Begin Menu mMain 
  64.       Caption         =   "&Window"
  65.       Index           =   1
  66.       Begin Menu mWin 
  67.          Caption         =   "&Cascade"
  68.          Index           =   0
  69.       End
  70.       Begin Menu mWin 
  71.          Caption         =   "Tile &Horizontally"
  72.          Index           =   1
  73.       End
  74.       Begin Menu mWin 
  75.          Caption         =   "Tile &Vertically"
  76.          Index           =   2
  77.       End
  78.       Begin Menu mWin 
  79.          Caption         =   "&Arrange Icons"
  80.          Index           =   3
  81.       End
  82.       Begin Menu mWin 
  83.          Caption         =   "-"
  84.          Index           =   4
  85.       End
  86.       Begin Menu mWin 
  87.          Caption         =   "Select &Window"
  88.          Index           =   5
  89.          WindowList      =   -1  'True
  90.       End
  91.    End
  92. End
  93. '---------------------------------------------------------------------------
  94. ' MDI Background Demo Program, Copyright (c) 1994 Karl E. Peterson
  95. ' Redistributed by permission.    CompuServe: 72302,3707
  96. ' See MDILOGO.BAS for complete description
  97. '---------------------------------------------------------------------------
  98.  
  99. 'Default behavior
  100.   DefInt A-Z
  101.   Option Explicit
  102.  
  103. 'Index into File menu
  104.   Const mnfHide = 0
  105.   Const mnfUnload = 1
  106.   Const mnfShowAll = 3
  107.   Const mnfExit = 5
  108.  
  109. 'Index into Window menu
  110.   Const mnwCascade = 0
  111.   Const mnwHorizontal = 1
  112.   Const mnwVertical = 2
  113.   Const mnwArrange = 3
  114.  
  115. Sub Command1_Click ()
  116.   mdiHide Me
  117. End Sub
  118.  
  119. Sub Form_Activate ()
  120.   'Required by a Control menu "Next" pick
  121.   'Otherwise we slip behind background
  122.     frmLogo.ZOrder 1
  123. End Sub
  124.  
  125. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  126.   'Update status bar
  127.     DisplayStatus ""
  128. End Sub
  129.  
  130. Sub Form_Paint ()
  131.   
  132.   'Display something on the form
  133.     If WindowState <> MINIMIZED Then
  134.       Cls
  135.       CurrentX = (ScaleWidth - TextWidth(Caption)) \ 2
  136.       CurrentY = (ScaleHeight - TextHeight(Caption)) \ 2
  137.       Print Caption
  138.     End If
  139.  
  140. End Sub
  141.  
  142. Sub Form_Resize ()
  143.   
  144.   If WindowState = MINIMIZED Then
  145.     'Required to keep icon and caption from slipping
  146.     'behind background
  147.       ZOrder 0
  148.       Caption = Caption
  149.   Else
  150.     'Display something in the form
  151.       Form_Paint
  152.   End If
  153.  
  154. End Sub
  155.  
  156. Sub Form_Unload (Cancel As Integer)
  157.   
  158.   'Set tracking element so this slot can be reused
  159.     fState(Val(Tag)) = frmDeleted
  160.  
  161. End Sub
  162.  
  163. Sub mForm_Click (Index As Integer)
  164.   
  165.   'React to menu picks
  166.     Select Case Index
  167.       Case mnfHide: mdiHide Me
  168.       Case mnfUnload: Unload Me
  169.       Case mnfShowAll: mdiShowAll
  170.       Case mnfExit: Unload frmMain
  171.     End Select
  172.  
  173. End Sub
  174.  
  175. Sub mWin_Click (Index As Integer)
  176.   
  177.   'React to menu picks
  178.     Select Case Index
  179.       Case mnwCascade: mdiArrange WM_MDICASCADE
  180.       Case mnwHorizontal: mdiArrange MDITILE_HORIZONTAL
  181.       Case mnwVertical: mdiArrange MDITILE_VERTICAL
  182.       Case mnwArrange: mdiArrange WM_MDIICONARRANGE
  183.     End Select
  184.  
  185. End Sub
  186.  
  187.